//
//  DiaryDetailTagView.swift
//  MyDiary2025
//
//  Created by 罗万能 on 2025/6/27.
//

import SwiftUI

struct DiaryDetailTagView: View {
    var diary: DiaryModel
    @State var showTag: AttributedString = AttributedString()
    var body: some View {
        ZStack(alignment: .leading) {
//            RoundedRectangle(cornerRadius: 12)
//                .foregroundStyle(.back.opacity(1))
//                .shadow(radius: 3)
            VStack{
                Text(showTag)
                
            }
        }
        .onAppear {
            for tag in diary.tag{
                var attribS = AttributedString("#\(tag.tagTitle)  ")
                attribS.font = .body
                attribS.foregroundColor = tag.tagColor
                showTag.append(attribS)
                
            }
        }
    }
}

#Preview {
    DiaryDetailTagView(diary: DiaryModel.debugData)
}
